package cn.waqwb.sms.service;

import java.util.Map;
import java.util.Set;

/**
 * 缓存接口
 * 对外提供能力
 *
 * @author JokerQ
 * @date 2020/5/27 - 14:37
 */
public interface CacheService {
    boolean set(String key, String value);

    //                                             过期时间
    boolean set(String key, String value, int expireTime);

    boolean set(String key, Object value);

    boolean set(String key, Object value, int expireTime);

    String get(String key);

    Object getObject(String key);

    Object setAndGet(String key, String value);

    //获取大小
    long size(String key);

    //删除  String...可变字符
    void del(String... keys);

    //过期时间
    boolean expire(String key, long seconds);

    //得到过期时间
    long getExpire(String key);

    //递增
    long incr(String key, long delta);

    //递减
    long decr(String key, long delta);

    //根据一定的规则获取多种key
    Set<String> keys(String pattern);

    //
    Map<Object, Object> hmget(String key);

    boolean hmset(String key, Map<String, Object> map);
}
